package com.hjq.demo.http.model

import com.hjq.http.config.IRequestInterceptor
import com.hjq.http.model.HttpHeaders
import com.hjq.http.model.HttpParams
import com.hjq.http.request.HttpRequest
import okhttp3.Request
import okhttp3.Response

/**
 * @author : Yang
 * @time   : 2024/7/7
 * desc    : 请求拦截器
 */
class RequestInterceptor : IRequestInterceptor {

    /**
     * 拦截参数
     * */
    override fun interceptArguments(
        httpRequest: HttpRequest<*>,
        params: HttpParams,
        headers: HttpHeaders
    ) {
    }

    /**
     * 拦截请求
     * */
    override fun interceptRequest(
        httpRequest: HttpRequest<*>,
        request: Request
    ): Request {
        return super.interceptRequest(httpRequest, request)
    }

    /**
     * 拦截响应
     * */
    override fun interceptResponse(
        httpRequest: HttpRequest<*>?,
        response: Response?
    ): Response {
        return super.interceptResponse(httpRequest, response)
    }

}